import axios from 'axios'
const token = localStorage.getItem('token')
if (!token){
  location.href = "../login/login.html"
}

axios({
  url: '/v1_0/user/profile'
}).then(res=>{
  document.querySelector('#username').innerHTML = res.data.name
})

document.querySelector('.logout').onclick = ()=>{
  localStorage.clear()
  location.href = "../login/login.html"
}